package DynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author ：MJS
 * @date ：Created in 2021/6/1  23:01
 * @description：TODO
 */
public class DynamicProxyHandler implements InvocationHandler {
    private Object object;

    public DynamicProxyHandler(Object object) {
        this.object = object;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("买车前的准备");
        Object result = method.invoke(object, args);
        System.out.println("买车后的准备");
        return result;
    }
}
